Skip to content

Conversation

imjlk
Copy link
Contributor

@imjlk imjlk commented Jun 23, 2025

Update the SvelteKit example to include shadcn-svelte, improve project structure, and enhance functionality with new components and configurations. This includes setting up database connections, user authentication, and setup instructions in the README.

I haven't tested whether there are any issues when following the README.md guide from the beginning, but the result of deploying during development was successful.

Deployed Url: https://bac-test-sveltekit-pages.pages.dev/

Based on the results merged in this PR, I am also planning to create an example for Hypderdrive, including the content that was previously closed (#7).

Please take a look. Thank you.

imjlk added 8 commits June 16, 2025 11:34
- Setup `bun x shadcn-svelte@latest init`
- Fixed formatting in svelte.config.js by ensuring a newline at the end of the file.
- Simplified types array in tsconfig.json for better readability.
- Added unplugin-icons to Vite configuration for enhanced icon support.
- Added "include" property to tsconfig.json to include src and drizzle.config.ts
- Enhanced wrangler.jsonc with compatibility flags and database configurations
  - Added D1 database configuration
  - Added KV namespace for auth session
  - Added R2 bucket for assets
"better-auth": "^1.1.21"
"@cloudflare/workers-types": "^4",
"better-auth": "^1.1.21",
"drizzle-orm": ">=0.37.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that the roadmap mentions Durable Objects, so I set drizzle-orm version 0.37 or higher. Durable Objects have been included since version 0.37.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I will need to look into drizzle for durable objects more - feel free to contribute in separate PR

}
},
// @ts-expect-error FIX: `@cloudflare/workers-types` is not compatible
kv: event?.platform?.env?.SVELTEKIT_PAGES_AUTH_SESSION_KV as KVNamespace,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part keeps causing a type error, but I don't know why.
I thought adding

"@cloudflare/workers-types": "^4",

as a peer dependency would solve it, but it didn't.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there other ways to access env?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it is cloudflare bug, currently safe to ignore

@zpg6
Copy link
Owner

zpg6 commented Aug 2, 2025

@imjlk - now that hyperdrive feature is merged, are you open to updating svelte kit example to use it?

Once it works I'll happily takeover hosting the pages deployment and Postgres/sql db of course.

@imjlk
Copy link
Contributor Author

imjlk commented Aug 5, 2025

@imjlk - now that hyperdrive feature is merged, are you open to updating svelte kit example to use it?

Once it works I'll happily takeover hosting the pages deployment and Postgres/sql db of course.

Ok, I'll try to update it soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants